import request from "@/utils/request";

//add集合
export function addUnionTaobao(data) {
  return request({
    // url: "/addUnionTaobao",
    url: "?s=addUnionTaobao",
    method: "post",
    data,
  });
}
export function addChannel(data) {
  return request({
    // url: "/addChannel",
    url: "?s=addChannel",
    method: "post",
    data,
  });
}
export function addCrontab(data) {
  return request({
    // url: "/addCrontab",
    url: "?s=addCrontab",
    method: "post",
    data,
  });
}
export function addUnionTaobaoSession(data) {
  return request({
    // url: "/addUnionTaobaoSession",
    url: "?s=addUnionTaobaoSession",
    method: "post",
    data,
  });
}
export function addUser(data) {
  return request({
    // url: "/addUser",
    url: "?s=addUser",
    method: "post",
    data,
  });
}
//update集合

//list集合
export function listCrontab(data) {
  return request({
    // url: "/listCrontab",
    url: "?s=listCrontab",
    method: "post",
    data,
  });
}

export function listUnionChannel(data) {
  return request({
    url: "?s=listUnionChannel",
    method: "post",
    data,
  });
}

export function listUnionName(data) {
  return request({
    url: "?s=listUnionName",
    method: "post",
    data,
  });
}

export function listUnionTaobao(data) {
  return request({
    // url: "/listUnionTaobao",
    url: "?s=listUnionTaobao",
    method: "post",
    data,
  });
}

export function listUsers(data) {
  return request({
    url: "?s=listUsers",
    method: "post",
    data,
  });
}

export function listHome(data) {
  return request({
    // url: "/listHome",
    url: "?s=listHome",
    method: "post",
    data,
  });
}
export function listOrder(data) {
  return request({
    // url: "/listOrder",
    url: "?s=listOrder",
    method: "post",
    data,
  });
}
export function listUserRanking(data) {
  return request({
    // url: "/listUserRanking",
    url: "?s=listUserRanking",
    method: "post",
    data,
  });
}
export function listSearch(data) {
  return request({
    url: "?s=listSearch",
    method: "post",
    data,
  });
}
export function listGoodsRanking(data) {
  return request({
    // url: "/listGoodsRanking",
    url: "?s=listGoodsRanking",
    method: "post",
    data,
  });
}
export function listTaolijinOrder(data) {
  return request({
    // url: "/listTaolijinOrder",
    url: "?s=listTaolijinOrder",
    method: "post",
    data,
  });
}
//del集合
export function delUnionTaobao(data) {
  return request({
    // url: "/delUnionTaobao",
    url: "?s=delUnionTaobao",
    method: "post",
    data,
  });
}
export function delUser(data) {
  return request({
    // url: "/delUser",
    url: "?s=delUser",
    method: "post",
    data,
  });
}
export function delChannel(data) {
  return request({
    // url: "/delChannel",
    url: "?s=delChannel",
    method: "post",
    data,
  });
}
//user集合
export async function userLogin(data) {
  let headers = {
    "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
  };
  return request({
    // url: "/userLogin",
    url: "?s=login",
    method: "post",
    data,
    headers: headers,
  });
}

export function userInfo(accessToken) {
  return request({
    // url: "/userInfo",
    url: "?s=user_info",
    method: "get",
    data: {
      accessToken,
    },
  });
}

export function userLogout() {
  return request({
    // url: "/userLogout",
    url: "?s=userLogout",
    method: "post",
  });
}

export function userAchievement(data) {
  //查用户收益
  return request({
    // url: "/userAchievement",
    url: "?s=userAchievement",
    method: "post",
    data,
  });
}

export function dataDetails(data) {
  //查用户收益
  return request({
    // url: "/dataDetails",
    url: "?s=dataDetails",
    method: "post",
    data,
  });
}

//other集合
export function linkGoods(data) {
  return request({
    // url: "/linkGoods",
    url: "?s=linkGoods",
    method: "post",
    data,
  });
}

export function linkTaolijin(data) {
  return request({
    // url: "/linkTaolijin",
    url: "?s=linkTaolijin",
    method: "post",
    data,
  });
}

export function totalOrder(data) {
  return request({
    // url: "/totalOrder",
    url: "?s=totalOrder",
    method: "post",
    data,
  });
}

export function updateTaoLijin(data) {
  return request({
    // url: "/updateTaoLijin",
    url: "?s=updateTaoLijin",
    method: "post",
    data,
  });
}
// 获取pid
export function getPid(data) {
  return request({
    url: "?s=get_pid",
    method: "post",
    data,
  });
}
// 绑定pid
export function bindPid(data) {
  return request({
    url: "?s=bind_pid",
    method: "post",
    data,
  });
}
// 删除pid
export function delPid(data) {
  return request({
    url: "?s=delBindPid",
    method: "post",
    data,
  });
}
// 添加备注
export function addDesc(data) {
  return request({
    url: "?s=addPidDesc",
    method: "post",
    data,
  });
}
// 获取全部用户
export function getAllUser(data) {
  return request({
    url: "?s=getAllUser",
    method: "get",
    data,
  });
}
// 增加任务
export function addUserAll(data) {
  return request({
    url: "?s=addUserAll",
    method: "post",
    data,
  });
}
// 一键转换
export function transformationLink(data) {
  return request({
    url: "?s=transformationLink",
    method: "post",
    data,
  });
}
